home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr52
/
clmsflpc.zip
/
BIN.DOC
next >
Wrap
Text File
|
1993-06-24
|
2KB
|
61 lines
=------------------------------------------=
Microsoft FP Conversion routines for Clipper
=------------------------------------------=
Introduction
------------
This =public domain= module, written for Clipper '87 and greater is
designed to facilitate conversions of numeric data stored in a string
format. This module is provided by:
Matthew Staben
Staben Technologies
811 West 14th Avenue
Spokane, WA 99204
Reasoning
---------
You'll find that Microsoft QuickBASIC (tm) stores numeric information
in a format which is quite confusing. The general Clipper programmer
may wish to read files which were create/modified by a QuickBASIC
program.
What's in Here?
---------------
Four functions are included in this small package, and are quite
fast once compiled. They are:
CVI(<expC>) expC must be a two byte string which represents an
integer value. The maximum value is 65,792.
CV(<espC>) expC must be a floating-point, any precision string
up to 64-bytes in length. This enables extremely
high precision, but will generally be used for four
and eight byte strings.
CV() replaces CVS() and CVD() in QuickBASIC. In
addition, CV() uses two additional modules, these
being binary/decimal conversion routines.
BIN2DEC(<expC>)
expC must be a string representing a binary number,
consisting of ones and zeros. It may also consist
of a decimal point and the fractional portion, which
represents the value beyond the decimal point.
example: bin2dec("10001000.101") == 136.625
DEC2BIN(<expV>,[<expN>])
expV must be a value within limits of conversion to
binary of the length desired. The default length is
64-bits.
example: dec2bin(235,8) == 11101011
dec2bin(235.62,25) == 00011101011.1001111010111
All that's required is to link BIN.OBJ (compiled from Clipper) with
your program, and call the routines as specified above.
Anyway, enjoy this little file. Many thanks to those who helped me
understand exactly what is going on inside this funny strings...